<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="批次号" prop="batchNo">
        <el-input
          v-model="queryParams.batchNo"
          placeholder="请输入批次号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="父子关系" prop="parentChild">
        <el-select v-model="queryParams.parentChild" placeholder="请选择父子关系" clearable size="small">
          <el-option
            v-for="dict in parentChildOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="产品分类" prop="productCategory">
        <el-input
          v-model="queryParams.productCategory"
          placeholder="请输入产品分类"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="变体主题" prop="variationTheme">
        <el-select v-model="queryParams.variationTheme" placeholder="请选择变体主题" clearable size="small">
          <el-option
            v-for="dict in variationThemeOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="国家代码" prop="countryCode">
        <el-select v-model="queryParams.countryCode" placeholder="请选择国家代码" clearable size="small">
          <el-option
            v-for="dict in countryCodeOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['amz:productTempImport:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['amz:productTempImport:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['amz:productTempImport:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-upload2"
          size="mini"
          @click="handleExport"
          v-hasPermi="['amz:productTempImport:export']"
        >导出</el-button>
      </el-col>
	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="productTempImportList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键自增" align="center" prop="id" />
      <el-table-column label="批次号" align="center" prop="batchNo" />
      <el-table-column label="父子关系" align="center" prop="parentChild" :formatter="parentChildFormat" />
      <el-table-column label="产品分类" align="center" prop="productCategory" />
      <el-table-column label="分类节点" align="center" prop="recommendedBrowseNode" />
      <el-table-column label="产品名称" align="center" prop="itemName" />
      <el-table-column label="价格" align="center" prop="standardPrice" />
      <el-table-column label="币种" align="center" prop="currencyType" />
      <el-table-column label="变体主题" align="center" prop="variationTheme" :formatter="variationThemeFormat" />
      <el-table-column label="颜色" align="center" prop="colorName" />
      <el-table-column label="尺码" align="center" prop="sizeName" />
      <el-table-column label="主图" align="center" prop="mainImageUrl" />
      <el-table-column label="附图1" align="center" prop="otherImageUrl1" />
      <el-table-column label="附图2" align="center" prop="otherImageUrl2" />
      <el-table-column label="附图3" align="center" prop="otherImageUrl3" />
      <el-table-column label="附图4" align="center" prop="otherImageUrl4" />
      <el-table-column label="附图5" align="center" prop="otherImageUrl5" />
      <el-table-column label="附图6" align="center" prop="otherImageUrl6" />
      <el-table-column label="附图7" align="center" prop="otherImageUrl7" />
      <el-table-column label="附图8" align="center" prop="otherImageUrl8" />
      <el-table-column label="产品特性1" align="center" prop="bulletPoint1" />
      <el-table-column label="产品特性2" align="center" prop="bulletPoint2" />
      <el-table-column label="产品特性3" align="center" prop="bulletPoint3" />
      <el-table-column label="产品特性4" align="center" prop="bulletPoint4" />
      <el-table-column label="产品特性5" align="center" prop="bulletPoint5" />
      <el-table-column label="产品描述" align="center" prop="productDescription" />
      <el-table-column label="国家代码" align="center" prop="countryCode" :formatter="countryCodeFormat" />
      <el-table-column label="采购链接" align="center" prop="buyingLink" />
      <el-table-column label="长" align="center" prop="length" />
      <el-table-column label="宽" align="center" prop="width" />
      <el-table-column label="高" align="center" prop="height" />
      <el-table-column label="重量" align="center" prop="weight" />
      <el-table-column label="材质" align="center" prop="material" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['amz:productTempImport:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['amz:productTempImport:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改产品导入对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="60%" :close-on-click-modal="false" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="批次号" prop="batchNo">
          <el-input v-model="form.batchNo" placeholder="请输入批次号" />
        </el-form-item>
        <el-form-item label="父子关系" prop="parentChild">
          <el-select v-model="form.parentChild" placeholder="请选择父子关系">
            <el-option
              v-for="dict in parentChildOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="产品分类" prop="productCategory">
          <el-input v-model="form.productCategory" placeholder="请输入产品分类" />
        </el-form-item>
        <el-form-item label="分类节点" prop="recommendedBrowseNode">
          <el-input v-model="form.recommendedBrowseNode" placeholder="请输入分类节点" />
        </el-form-item>
        <el-form-item label="产品名称" prop="itemName">
          <el-input v-model="form.itemName" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="价格" prop="standardPrice">
          <el-input v-model="form.standardPrice" placeholder="请输入价格" />
        </el-form-item>
        <el-form-item label="币种" prop="currencyType">
          <el-select v-model="form.currencyType" placeholder="请选择币种">
            <el-option
              v-for="dict in currencyTypeOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="变体主题" prop="variationTheme">
          <el-select v-model="form.variationTheme" placeholder="请选择变体主题">
            <el-option
              v-for="dict in variationThemeOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="颜色" prop="colorName">
          <el-input v-model="form.colorName" placeholder="请输入颜色" />
        </el-form-item>
        <el-form-item label="尺码" prop="sizeName">
          <el-input v-model="form.sizeName" placeholder="请输入尺码" />
        </el-form-item>
        <el-form-item label="主图" prop="mainImageUrl">
          <el-input v-model="form.mainImageUrl" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="附图1" prop="otherImageUrl1">
          <el-input v-model="form.otherImageUrl1" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="附图2" prop="otherImageUrl2">
          <el-input v-model="form.otherImageUrl2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="附图3" prop="otherImageUrl3">
          <el-input v-model="form.otherImageUrl3" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="附图4" prop="otherImageUrl4">
          <el-input v-model="form.otherImageUrl4" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="附图5" prop="otherImageUrl5">
          <el-input v-model="form.otherImageUrl5" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="附图6" prop="otherImageUrl6">
          <el-input v-model="form.otherImageUrl6" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="附图7" prop="otherImageUrl7">
          <el-input v-model="form.otherImageUrl7" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="附图8" prop="otherImageUrl8">
          <el-input v-model="form.otherImageUrl8" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产品特性1" prop="bulletPoint1">
          <el-input v-model="form.bulletPoint1" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产品特性2" prop="bulletPoint2">
          <el-input v-model="form.bulletPoint2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产品特性3" prop="bulletPoint3">
          <el-input v-model="form.bulletPoint3" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产品特性4" prop="bulletPoint4">
          <el-input v-model="form.bulletPoint4" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产品特性5" prop="bulletPoint5">
          <el-input v-model="form.bulletPoint5" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产品描述" prop="productDescription">
          <el-input v-model="form.productDescription" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="国家代码" prop="countryCode">
          <el-select v-model="form.countryCode" placeholder="请选择国家代码">
            <el-option
              v-for="dict in countryCodeOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="采购链接" prop="buyingLink">
          <el-input v-model="form.buyingLink" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="长" prop="length">
          <el-input v-model="form.length" placeholder="请输入长" />
        </el-form-item>
        <el-form-item label="宽" prop="width">
          <el-input v-model="form.width" placeholder="请输入宽" />
        </el-form-item>
        <el-form-item label="高" prop="height">
          <el-input v-model="form.height" placeholder="请输入高" />
        </el-form-item>
        <el-form-item label="重量" prop="weight">
          <el-input v-model="form.weight" placeholder="请输入重量" />
        </el-form-item>
        <el-form-item label="材质" prop="material">
          <el-input v-model="form.material" placeholder="请输入材质" />
        </el-form-item>
        <el-form-item label="创建人" prop="createBy">
          <el-input v-model="form.createBy" placeholder="请输入创建人" />
        </el-form-item>
        <el-form-item label="创建时间" prop="createTime">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="form.createTime"
            type="date"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="选择创建时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="更新人" prop="updateBy">
          <el-input v-model="form.updateBy" placeholder="请输入更新人" />
        </el-form-item>
        <el-form-item label="更新时间" prop="updateTime">
          <el-date-picker clearable size="small" style="width: 200px"
            v-model="form.updateTime"
            type="date"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="选择更新时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listProductTempImport, getProductTempImport, delProductTempImport, addProductTempImport, updateProductTempImport, exportProductTempImport } from "@/api/amz/productTempImport";

export default {
  name: "ProductTempImport",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 产品导入表格数据
      productTempImportList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 主键自增字典
      idOptions: [],
      // 批次号字典
      batchNoOptions: [],
      // 父子关系字典
      parentChildOptions: [],
      // 产品分类字典
      productCategoryOptions: [],
      // 分类节点字典
      recommendedBrowseNodeOptions: [],
      // 产品名称字典
      itemNameOptions: [],
      // 价格字典
      standardPriceOptions: [],
      // 币种字典
      currencyTypeOptions: [],
      // 变体主题字典
      variationThemeOptions: [],
      // 颜色字典
      colorNameOptions: [],
      // 尺码字典
      sizeNameOptions: [],
      // 主图字典
      mainImageUrlOptions: [],
      // 附图1字典
      otherImageUrl1Options: [],
      // 附图2字典
      otherImageUrl2Options: [],
      // 附图3字典
      otherImageUrl3Options: [],
      // 附图4字典
      otherImageUrl4Options: [],
      // 附图5字典
      otherImageUrl5Options: [],
      // 附图6字典
      otherImageUrl6Options: [],
      // 附图7字典
      otherImageUrl7Options: [],
      // 附图8字典
      otherImageUrl8Options: [],
      // 产品特性1字典
      bulletPoint1Options: [],
      // 产品特性2字典
      bulletPoint2Options: [],
      // 产品特性3字典
      bulletPoint3Options: [],
      // 产品特性4字典
      bulletPoint4Options: [],
      // 产品特性5字典
      bulletPoint5Options: [],
      // 产品描述字典
      productDescriptionOptions: [],
      // 国家代码字典
      countryCodeOptions: [],
      // 采购链接字典
      buyingLinkOptions: [],
      // 长字典
      lengthOptions: [],
      // 宽字典
      widthOptions: [],
      // 高字典
      heightOptions: [],
      // 重量字典
      weightOptions: [],
      // 材质字典
      materialOptions: [],
      // 创建人字典
      createByOptions: [],
      // 创建时间字典
      createTimeOptions: [],
      // 更新人字典
      updateByOptions: [],
      // 更新时间字典
      updateTimeOptions: [],
      // 备注字典
      remarkOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        batchNo: null,
        parentChild: null,
        productCategory: null,
        variationTheme: null,
        countryCode: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        parentChild: [
          { required: true, message: "父子关系不能为空", trigger: "change" }
        ],
        productCategory: [
          { required: true, message: "产品分类不能为空", trigger: "blur" }
        ],
        itemName: [
          { required: true, message: "产品名称不能为空", trigger: "blur" }
        ],
        standardPrice: [
          { required: true, message: "价格不能为空", trigger: "blur" }
        ],
        currencyType: [
          { required: true, message: "币种不能为空", trigger: "change" }
        ],
        variationTheme: [
          { required: true, message: "变体主题不能为空", trigger: "change" }
        ],
        mainImageUrl: [
          { required: true, message: "主图不能为空", trigger: "blur" }
        ],
        otherImageUrl1: [
          { required: true, message: "附图1不能为空", trigger: "blur" }
        ],
        bulletPoint1: [
          { required: true, message: "产品特性1不能为空", trigger: "blur" }
        ],
        productDescription: [
          { required: true, message: "产品描述不能为空", trigger: "blur" }
        ],
        countryCode: [
          { required: true, message: "国家代码不能为空", trigger: "change" }
        ],
        createTime: [
          { required: true, message: "创建时间不能为空", trigger: "blur" }
        ],
        updateTime: [
          { required: true, message: "更新时间不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
    this.getDicts("${column.dictType}").then(response => {
      this.idOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.batchNoOptions = response.data;
    });
    this.getDicts("amz_parent_child").then(response => {
      this.parentChildOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.productCategoryOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.recommendedBrowseNodeOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.itemNameOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.standardPriceOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.currencyTypeOptions = response.data;
    });
    this.getDicts("amz_variation_theme").then(response => {
      this.variationThemeOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.colorNameOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.sizeNameOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.mainImageUrlOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.otherImageUrl1Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.otherImageUrl2Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.otherImageUrl3Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.otherImageUrl4Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.otherImageUrl5Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.otherImageUrl6Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.otherImageUrl7Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.otherImageUrl8Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.bulletPoint1Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.bulletPoint2Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.bulletPoint3Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.bulletPoint4Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.bulletPoint5Options = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.productDescriptionOptions = response.data;
    });
    this.getDicts("qc_country_code").then(response => {
      this.countryCodeOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.buyingLinkOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.lengthOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.widthOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.heightOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.weightOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.materialOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.createByOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.createTimeOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.updateByOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.updateTimeOptions = response.data;
    });
    this.getDicts("${column.dictType}").then(response => {
      this.remarkOptions = response.data;
    });
  },
  methods: {
    /** 查询产品导入列表 */
    getList() {
      this.loading = true;
      listProductTempImport(this.queryParams).then(response => {
        this.productTempImportList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 父子关系字典翻译
    parentChildFormat(row, column) {
      return this.selectDictLabel(this.parentChildOptions, row.parentChild);
    },
    // 变体主题字典翻译
    variationThemeFormat(row, column) {
      return this.selectDictLabel(this.variationThemeOptions, row.variationTheme);
    },
    // 国家代码字典翻译
    countryCodeFormat(row, column) {
      return this.selectDictLabel(this.countryCodeOptions, row.countryCode);
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        batchNo: null,
        parentChild: null,
        productCategory: null,
        recommendedBrowseNode: null,
        itemName: null,
        standardPrice: null,
        currencyType: null,
        variationTheme: null,
        colorName: null,
        sizeName: null,
        mainImageUrl: null,
        otherImageUrl1: null,
        otherImageUrl2: null,
        otherImageUrl3: null,
        otherImageUrl4: null,
        otherImageUrl5: null,
        otherImageUrl6: null,
        otherImageUrl7: null,
        otherImageUrl8: null,
        bulletPoint1: null,
        bulletPoint2: null,
        bulletPoint3: null,
        bulletPoint4: null,
        bulletPoint5: null,
        productDescription: null,
        countryCode: null,
        buyingLink: null,
        length: null,
        width: null,
        height: null,
        weight: null,
        material: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加产品导入";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getProductTempImport(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改产品导入";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateProductTempImport(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addProductTempImport(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm('是否确认删除产品导入编号为"' + ids + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delProductTempImport(ids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有产品导入数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportProductTempImport(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
